﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace centraldba_library.Data
{
    /// <summary>
    /// Represents a Backup Performed in Microsoft SQL Server
    /// (Used to be centraldba_dbrestore_utility.Data.MyBackup)
    /// </summary>
    public class backup
    {
        private Int64 _id;
        private int _backup_set_id;
        private System.DateTime _backup_start_date;
        private bool _has_bulk_logged_data, _file_exists, _recovery_path_broken;
        private decimal _backup_size;
        private string _database_name, _name, _type, _physical_device_name;

        public Int64 id
        {
            get { return this._id; }
            set { if (this._id != value) { this._id = value; } }
        }

        public int backup_set_id
        {
            get { return this._backup_set_id; }
            set { if (this._backup_set_id != value) { this._backup_set_id = value; } }
        }

        public string database_name
        {
            get { return this._database_name; }
            set { if (this._database_name != value) { this._database_name = value; } }
        }

        public string name
        {
            get { return this._name; }
            set { if (this._name != value) { this._name = value; } }
        }

        public string type
        {
            get { return this._type; }
            set { if (this._type != value) { this._type = value; } }
        }

        public string type_description
        {
            get
            {
                string value = "";

                switch (this._type)
                {
                    case "L":
                        value = "Log";
                        break;
                    case "D":
                        value = "Full";
                        break;
                    case "I":
                        value = "Diff";
                        break;
                    default:
                        value = "Unk";
                        break;
                }

                return value;
            }
        }

        public System.DateTime backup_start_date
        {
            get { return this._backup_start_date; }
            set { if (this._backup_start_date != value) { this._backup_start_date = value; } }
        }

        public bool recovery_path_broken
        {
            get { return this._recovery_path_broken; }
            set { if (this._recovery_path_broken != value) { this._recovery_path_broken = value; } }
        }

        public bool has_bulk_logged_data
        {
            get { return this._has_bulk_logged_data; }
            set { if (this._has_bulk_logged_data != value) { this._has_bulk_logged_data = value; } }
        }

        public decimal backup_size
        {
            get { return this._backup_size; }
            set { if (this._backup_size != value) { this._backup_size = value; } }
        }

        public string physical_device_name
        {
            get { return this._physical_device_name; }
            set { if (this._physical_device_name != value) { this._physical_device_name = value; } }
        }

        public bool file_exists
        {
            get { return this._file_exists; }
            set { if (this._file_exists != value) { this._file_exists = value; } }
        }
    }
}
